/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author niit
 */
@Entity
@Table(name = "fl_admin")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FlAdmin.findAll", query = "SELECT f FROM FlAdmin f"),
    @NamedQuery(name = "FlAdmin.findByAdminid", query = "SELECT f FROM FlAdmin f WHERE f.adminid = :adminid")})
public class FlAdmin implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "adminid")
    private Integer adminid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "adminid")
    private List<FlMessage> flMessageList;
    @JoinColumn(name = "memberid", referencedColumnName = "memberid")
    @ManyToOne
    private FlMember memberid;

    public FlAdmin() {
    }

    public FlAdmin(Integer adminid) {
        this.adminid = adminid;
    }

    public Integer getAdminid() {
        return adminid;
    }

    public void setAdminid(Integer adminid) {
        this.adminid = adminid;
    }

    @XmlTransient
    public List<FlMessage> getFlMessageList() {
        return flMessageList;
    }

    public void setFlMessageList(List<FlMessage> flMessageList) {
        this.flMessageList = flMessageList;
    }

    public FlMember getMemberid() {
        return memberid;
    }

    public void setMemberid(FlMember memberid) {
        this.memberid = memberid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (adminid != null ? adminid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FlAdmin)) {
            return false;
        }
        FlAdmin other = (FlAdmin) object;
        if ((this.adminid == null && other.adminid != null) || (this.adminid != null && !this.adminid.equals(other.adminid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FlAdmin[ adminid=" + adminid + " ]";
    }
    
}
